package com.example.demoapi.api.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author Hu
 * @date 2023/2/6
 * @apiNote
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private Integer code;
    private String msg;
    private Object data;

    public static Result success(String msg) {
        return new Result(200, msg, null);
    }

    public static Result error(String msg) {
        return new Result(500, msg, null);
    }

    public static Result success(Object obj) {
        return new Result(200, null, obj);
    }
}
